﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Platformer
{
    class Camera
    {
        private Vector2 _mPosition;
        public Vector2 Position
        {
            get
            {
                return _mPosition;
            }
            set
            {
                _mPosition.X = value.X;
                _mPosition.Y = value.Y;
            }
        }


        public Matrix GetTransformationMatrix(GraphicsDevice gd)
        {
            Matrix result = new Matrix();
            result =
                Matrix.CreateTranslation(-Position.X, -Position.Y, 0)
                *Matrix.CreateTranslation(gd.Viewport.Width*0.5f,gd.Viewport.Height*0.5f,0);
            return result;
        }
    }
}
